package com.gwz.cardserver.dto.fight;

import com.gwz.cardserver.consts.IdentityEnum;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 玩家数据
 */
@Data
public class PlayerDto {
    /**
     * 用户id
     */
    private String userId;
    /**
     * 身份
     */
    private int identity = -IdentityEnum.FARMER.getCode();
    /**
     * 手牌
     */
    private List<CardDto> cardList = new ArrayList<>();

    /**
     * 是否有手牌
     * true 有
     * false 没有
     * @return
     */
    public boolean hasCard() {
        return cardList.size() !=0;
    }

    public int cardCount(){
        return cardList.size();
    }
    public void addCard(CardDto cardDto){
        this.cardList.add(cardDto);
    }
    public void removeCard(CardDto cardDto){
        this.cardList.remove(cardDto);
    }

}
